package com.sj.service.impl;

import com.sj.entity.Praise;
import com.sj.mapper.PraiseMapper;
import com.sj.service.PraiseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 点赞表 服务实现类
 * </p>
 *
 * @author 孙峻
 * @since 2022-03-09
 */
@Service
public class PraiseServiceImpl extends ServiceImpl<PraiseMapper, Praise> implements PraiseService {

    @Autowired
    private PraiseMapper praiseMapper;

    @Override
    public Long getSumPraiseNum(Integer id, String type) {
        return praiseMapper.getSumPraiseNum(id, type);
    }

    @Override
    public Boolean checkUserIsPraise(Integer uid, Integer id, String type , Integer praiseType) {
        return praiseMapper.checkUserIsPraise(uid, id, type , praiseType) > 0;
    }
}
